package java2020spring;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
import static javax.swing.JFrame.*;
public class 可暂时忽略 extends JFrame{
	JMenuBar bar;
	JMenu file,edit,geshi,look,help;
	JMenuItem create,open,save,lingcun;//文件菜单栏的功能
	JMenuItem chexiao,jianqie,copy,niantie,delete;//编辑菜单栏的功能
	JMenuItem autoNextLine;//格式中的自动换行
	JMenuItem conditon;//查看中的状态栏
	JMenuItem lookForHelp,about;//帮助中的功能
//	Font font=new Font();
	public 可暂时忽略(String s,int x,int y,int w,int h) {
		setLocation(x,y);
		text();
		setSize(w,h);
		setVisible(true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		init(s);
		
	}
	void init(String s) {
		setTitle(s);
		bar=new JMenuBar();
		file=new JMenu("文件");
		edit=new JMenu("编辑");
		geshi=new JMenu("格式");
		look=new JMenu("查看");
		help=new JMenu("帮助");
		create=new JMenuItem("新建");
		open=new JMenuItem("打开");
		save=new JMenuItem("保存");
		lingcun=new JMenuItem("另存为");
		chexiao=new JMenuItem("撤销");
		jianqie=new JMenuItem("剪切");
		copy=new JMenuItem("复制");
		niantie=new JMenuItem("粘贴");
		delete=new JMenuItem("删除");
		autoNextLine=new JMenuItem("自动换行");
		conditon=new JMenuItem("状态栏");
		lookForHelp=new JMenuItem("查看帮助");
		about=new JMenuItem("关于记事本");
		bar.add(file);
		bar.add(edit);
		bar.add(geshi);
		bar.add(look);
		bar.add(help);
		file.add(create);//文件
		file.add(open);
		file.add(save);
		file.add(lingcun);
		create.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,InputEvent.CTRL_MASK));
		open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,InputEvent.CTRL_DOWN_MASK));
		save.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_MASK));
		edit.add(chexiao);//编辑
		edit.add(jianqie);
		edit.add(copy);
		edit.add(niantie);
		chexiao.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z,InputEvent.CTRL_DOWN_MASK));
		jianqie.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,InputEvent.CTRL_DOWN_MASK));
		copy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C,InputEvent.CTRL_DOWN_MASK));
		niantie.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V,InputEvent.CTRL_DOWN_MASK));
		edit.add(delete);
		geshi.add(autoNextLine);//格式
		look.add(conditon);//查看
		help.add(lookForHelp);//帮助
		help.add(about);
		setJMenuBar(bar);
	}
	JTextArea text() {
		JTextArea area;
		area=new JTextArea();
		area.setSize(getSize());
		area.setText("heoo");
		area.setFont(new Font(null,0,20));
		return area;
}
}
